﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Examples_HomePage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Force the first accordian panel to open with javascript
            accordian.RequireOpenedPane = false;
            ClientScript.RegisterStartupScript(this.GetType(), "expandInitial", "Sys.Application.add_load(expandInitial);", true);
        }
        else
        {
            accordian.RequireOpenedPane = true;
        }

    }

    protected void btnRegister_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            pnlRegistered.Visible = true;
            pnlRegister.Visible = false;
        }
    }

    protected void btnCompRegister_Click(object sender, EventArgs e)
    {
        if (IsValid)
        {
            pnlRegisteredComp.Visible = true;
            pnlRegisterComp.Visible = false;
        }
    }

    protected void dlCountries_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (dlCountries.SelectedIndex == 0)
        {
            faqSelected.Visible = false;
            faqUnSelected.Visible = false;
            regCompSelected.Visible = false;
            regCompUnSelected.Visible = false;
        }
        else
        {
            faqSelected.Visible = regCompUnSelected.Visible = true;
            faqUnSelected.Visible = regCompSelected.Visible = false;
            dlFQA.DataBind();
        }
    }

    protected void lnkRegCompUnSelected_Click(object sender, EventArgs e)
    {
        faqSelected.Visible = regCompUnSelected.Visible = false;
        faqUnSelected.Visible = regCompSelected.Visible = true;
    }

    protected void lnkFaqUnSelected_Click(object sender, EventArgs e)
    {
        faqSelected.Visible = regCompUnSelected.Visible = true;
        faqUnSelected.Visible = regCompSelected.Visible = false;
    }

    protected void dsFAQ_SelectData(object sender, Acms.DataControls.SelectEventArgs<Acms.Bll.Post> e)
    {
        e.SetData(new Acms.Bll.Post[3]);
    }

    
}
